<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/common.jsp"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="java.util.*" %>
<html>
  <head>
  <title>权限表</title>
  <%@ include file="/common/meta.jsp"%>     
  <link href="<c:url value='/styles/form.css'/>" type="text/css" rel="stylesheet">
  </head>
  <% 
  	List rolePermissionList =(List)request.getAttribute("rolePermissionList");
  	String roleid=request.getParameter("id");
  	Iterator irolePermissionList=rolePermissionList.iterator();
  	String strPermission="";
  	while(irolePermissionList.hasNext()){
  		Map temp=(Map)irolePermissionList.next();
  		strPermission=strPermission+";"+temp.get("PERMISSION_CODE");
  	}
  %>
  <script>
  	function load(){
  		var obj=document.getElementsByName("ids");
  		var strPermission="<%=strPermission%>";
  		var strPermissions=strPermission.split(";");
  		for(var i=0;i<strPermissions.length;i++){
  			for(var j=0;j<obj.length;j++){
  				if(strPermissions[i]==obj[j].value){
  					obj[j].checked=true;
  				}
  			}
  		}
  	}
  </script>
  <body onload="load()">
	<div align="center" >
		<div id="detailheader">
			<img src="<%=request.getContextPath()%>/images/main/main_ban01Dot.png" />
			<div>权限表</div>
		</div>		 
		<html:form action="/role.do?method=updateperssion" method="post">			
			<div class="formTable" style="width:90%;">
				<div class="formTitle">
					
					<div class="formTitleM">权限表</div>
					
				</div>
				<div class="formContent">
							<table width="90%">
							<input type=hidden name="roleId" value="<%=roleid%>">
								<logic:iterate id="result" name="resultList">
									<tr>
										<td align="center"><input type="checkbox" name=ids value="<bean:write name='result' property='permissionCode'/>"> <br></td>
										<td align="center" nowrap="nowrap">
										<bean:write name="result" property="permissionName"/>
										</td>
									</tr>
								</logic:iterate>
								<tr>
									<td align="center" colspan="2">
										<html:submit styleClass="btn_Xp_Bg0" value="确 定"/>&nbsp;&nbsp;&nbsp;
										<html:reset styleClass="btn_Xp_Bg0" value="重 置"/>
									</td>
								</tr>
							</table>
				</div>
			</div>
		</html:form>
		</div>
	</body>	
</html>
